using System;
using System.Collections.Generic;
using System.Text;

namespace DslEditorPowerToy.Controls.Editors.Special.DomainModelTreeGrid.Data
{
    internal delegate void ChildElementAddedEventHandler(object sender, ChildElementAddedEventArgs e);
    internal delegate void ChildElementRemovedEventHandler(object sender, ChildElementRemovedEventArgs e);
    internal delegate void ChildElementMovedEventHandler(object sender, ChildElementMovedEventArgs e);
    internal delegate void PropertiesUpdatedEventHandler(object sender, PropertiesUpdatedEventArgs e);

    internal abstract class ElementEventArgs : EventArgs
    {
        IDomainElement _element = null;

        #region Constructors
        protected ElementEventArgs(IDomainElement element)
            : base()
        {
            this._element = element;
        }
        #endregion

        #region Protected Properties
        protected IDomainElement Element
        {
            get
            {
                return this._element;
            }
        }
        #endregion
    }
    internal class ChildElementAddedEventArgs : ElementEventArgs
    {
        #region Constructors
        public ChildElementAddedEventArgs(IDomainElement addedElement)
            : base(addedElement)
        {
        }
        #endregion

        #region Public Properties
        public IDomainElement AddedElement
        {
            get
            {
                return this.Element;
            }
        }
        #endregion
    }
    internal class ChildElementRemovedEventArgs : ElementEventArgs
    {
        private IDomainElement _deletedElement;

        #region Constructors
        public ChildElementRemovedEventArgs(IDomainElement deletedElement)
            : base(deletedElement)
        {
            this._deletedElement = deletedElement;
        }
        #endregion

        #region Public Properties
        public IDomainElement DeletedElement
        {
            get
            {
                return this._deletedElement;
            }
        }
        #endregion
    }
    internal class ChildElementMovedEventArgs : ElementEventArgs
    {
        #region Constructors
        public ChildElementMovedEventArgs(IDomainElement movedElement)
            : base(movedElement)
        {
        }
        #endregion

        #region Public Properties
        public IDomainElement MovedElement
        {
            get
            {
                return this.Element;
            }
        }
        #endregion
    }
    internal class PropertiesUpdatedEventArgs : ElementEventArgs
    {
        #region Constructors
        public PropertiesUpdatedEventArgs(IDomainElement updatedElement)
            : base(updatedElement)
        {
        }
        #endregion

        #region Public Properties
        public IDomainElement UpdatedElement
        {
            get
            {
                return this.Element;
            }
        }
        #endregion
    }
}
